public class Oopzy02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        KgcClass java78 = new KgcClass();
        java78.name = "牛x的java78";
        java78.dirTeacher = "Old Liu";
        int choice = 0;
        while (true) {
            System.out.println("1:加新生,2:查看信息，3:查找，4：按照范围查找，5：按指定位置查找，6：修改学生姓名，7：获取班级人数，8：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新生的姓名：");
                String sname = in.next();
                java78.add(sname);
            } else if (choice == 2) {
                java78.showInformation();
            } else if (choice == 3) {
                System.out.println("找谁？");
                String name = in.next();
                boolean exists = java78.findName(name);
                if (exists) {
                    System.out.println(name + "在这个班");
                } else {
                    System.out.println(name + "不在这个班");
                }
            } else if (choice == 4) {
                System.out.print("请输入起点：");
                int start = in.nextInt();
                System.out.print("请输入终点：");
                int end = in.nextInt();
                System.out.print("找谁：");
                String name = in.next();
                boolean exists = false;
                if (exists) {
                    System.out.println(name + "在这个班");
                } else {
                    System.out.println(name + "不在这个班");
                }
            } else if (choice == 5) {
                System.out.println("请输入要查找的目录数");
                int index = in.nextInt();
                System.out.println(java78.find(index));
            } else if (choice == 6) {
                System.out.println("请输入要修改的学生姓名");
                String oldName = in.next();
                System.out.println("请输入修改后的学生姓名");
                String newName = in.next();
                boolean change = java78.update(oldName, newName);
                if (change) System.out.println("修改成功");
                else System.out.println("修改失败");
            } else if (choice == 7) {
                int num = java78.getNum();
                System.out.println("一共" + (num-1) + "个人");
            } else if (choice == 8) {
                break;
            }
        }
    }
}